home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2002 January / january_2002.iso / Piposh Special / Piposh / WEST1.DXR / 00149.ls < prev    next >
Encoding:
Text File  |  2004-12-06  |  8.6 KB  |  237 lines

  1. on strata
  2.   global ppl, vppl, trgt
  3.   y2 = duplicate(vppl)
  4.   x2 = duplicate(ppl)
  5.   repeat with i = 2 to 9
  6.     if (getAt(ppl, 1) < getAt(ppl, i)) and (getAt(vppl, 1) > getAt(vppl, i)) then
  7.       u = getAt(ppl, 1)
  8.       setAt(ppl, 1, getAt(ppl, i))
  9.       setAt(ppl, i, u)
  10.       oldm = the member of sprite getAt(ppl, 1)
  11.       oldflip = sprite(getAt(ppl, 1)).flipH
  12.       oldvis = sprite(getAt(ppl, 1)).visible
  13.       sprite(getAt(ppl, 1)).visible = sprite(getAt(ppl, i)).visible
  14.       sprite(getAt(ppl, i)).visible = oldvis
  15.       sprite(getAt(ppl, 1)).flipH = sprite(getAt(ppl, i)).flipH
  16.       sprite(getAt(ppl, i)).flipH = oldflip
  17.       set the member of sprite getAt(ppl, 1) to member(the memberNum of sprite getAt(ppl, i), 1)
  18.       set the member of sprite getAt(ppl, i) to oldm
  19.       oldloc = the loc of sprite getAt(ppl, 1)
  20.       set the loc of sprite getAt(ppl, 1) to the loc of sprite getAt(ppl, i)
  21.       set the loc of sprite getAt(ppl, i) to oldloc
  22.       updateStage()
  23.       next repeat
  24.     end if
  25.     if (getAt(ppl, 1) > getAt(ppl, i)) and (getAt(vppl, 1) < getAt(vppl, i)) then
  26.       u = getAt(ppl, 1)
  27.       setAt(ppl, 1, getAt(ppl, i))
  28.       setAt(ppl, i, u)
  29.       oldm = the member of sprite getAt(ppl, 1)
  30.       oldflip = sprite(getAt(ppl, 1)).flipH
  31.       oldvis = sprite(getAt(ppl, 1)).visible
  32.       sprite(getAt(ppl, 1)).visible = sprite(getAt(ppl, i)).visible
  33.       sprite(getAt(ppl, i)).visible = oldvis
  34.       sprite(getAt(ppl, 1)).flipH = sprite(getAt(ppl, i)).flipH
  35.       sprite(getAt(ppl, i)).flipH = oldflip
  36.       set the member of sprite getAt(ppl, 1) to member(the memberNum of sprite getAt(ppl, i), 1)
  37.       set the member of sprite getAt(ppl, i) to oldm
  38.       oldloc = the loc of sprite getAt(ppl, 1)
  39.       set the loc of sprite getAt(ppl, 1) to the loc of sprite getAt(ppl, i)
  40.       set the loc of sprite getAt(ppl, i) to oldloc
  41.       updateStage()
  42.     end if
  43.   end repeat
  44. end
  45.  
  46. on brain i
  47.   global ppl, vppl, hppl, trgt, xpnt, ypnt, muchpnt, blty, bltx, bltsprite, bltwich, mnv, fxpath
  48.   if (getAt(trgt, i) = "s") or (getAt(trgt, i) = "b") or (getAt(trgt, i) = "r") or (getAt(trgt, i) = "m") then
  49.     if getAt(ypnt, i) < 0 then
  50.       setAt(ypnt, i, getAt(vppl, i))
  51.     end if
  52.     if (getAt(vppl, i) <= getAt(ypnt, i)) and ((getAt(hppl, i) >= (getAt(xpnt, i) - 20)) and (getAt(hppl, i) <= (getAt(xpnt, i) + 20))) then
  53.       setAt(muchpnt, i, getAt(muchpnt, i) - 1)
  54.       if getAt(muchpnt, i) < -1 then
  55.         setAt(trgt, i, "d")
  56.         setAt(vppl, i, 1000 + i)
  57.         setAt(hppl, i, 1000 + i)
  58.         put value(the text of field "stole") + 1 into field "stole"
  59.         set the member of sprite getAt(ppl, i) to member(148, 1)
  60.         set the loc of sprite i to point(690, 490)
  61.       else
  62.         if (getAt(muchpnt, i) = 0) or (getAt(muchpnt, i) = -1) then
  63.           if getAt(trgt, i) <> "m" then
  64.             if getAt(trgt, i) = "s" then
  65.               setAt(mnv, i, 24)
  66.               sprite(5).visible = 1
  67.               if the memberNum of sprite 5 = 174 then
  68.                 set the member of sprite 5 to member(175, 1)
  69.               else
  70.                 set the member of sprite 5 to member(174, 1)
  71.               end if
  72.             else
  73.               sprite(6).visible = 1
  74.               setAt(mnv, i, 17)
  75.               if the memberNum of sprite 6 = 172 then
  76.                 set the member of sprite 6 to member(176, 1)
  77.               else
  78.                 set the member of sprite 6 to member(172, 1)
  79.               end if
  80.             end if
  81.             setAt(trgt, i, "m")
  82.             sprite(getAt(ppl, i)).visible = 0
  83.           else
  84.             if getAt(mnv, i) < 1 then
  85.               setAt(trgt, i, "r")
  86.               sprite(getAt(ppl, i)).visible = 1
  87.               hh = [0, 0, 300, 450, 640, 640]
  88.               yy = [300, 340, 480, 480, 400, 350]
  89.               ws = random(6)
  90.               if abs(getAt(vppl, i) - getAt(yy, ws)) > abs(getAt(hppl, i) - getAt(hh, ws)) then
  91.                 if (getAt(vppl, i) - getAt(yy, ws)) > 0 then
  92.                   set the member of sprite getAt(ppl, i) to member(67, 1)
  93.                 else
  94.                   set the member of sprite getAt(ppl, i) to member(156, 1)
  95.                 end if
  96.               else
  97.                 set the member of sprite getAt(ppl, i) to member(93, 1)
  98.                 if (getAt(hppl, i) - getAt(hh, ws)) > 0 then
  99.                   sprite(getAt(ppl, i)).flipH = 1
  100.                 else
  101.                   sprite(getAt(ppl, i)).flipH = 0
  102.                 end if
  103.               end if
  104.               setAt(ypnt, i, getAt(yy, ws))
  105.               setAt(xpnt, i, getAt(hh, ws))
  106.             end if
  107.           end if
  108.         else
  109.           e = [208, 217, 521, 217]
  110.           if getAt(trgt, i) = "s" then
  111.             if getAt(muchpnt, i) = 1 then
  112.               tempv = getAt(e, 4)
  113.               temph = getAt(e, 3)
  114.             else
  115.               tempv = getAt(vppl, i) - getAt(e, 4)
  116.               tempv = random(tempv - 30)
  117.               tempv = getAt(vppl, i) - tempv
  118.               temph = getAt(hppl, i) - 200
  119.               if temph < 20 then
  120.                 temph = 20
  121.               end if
  122.               temph = random(400) + temph
  123.               if temph > 620 then
  124.                 temph = 620
  125.               end if
  126.             end if
  127.           else
  128.             if getAt(muchpnt, i) = 1 then
  129.               tempv = getAt(e, 2)
  130.               temph = getAt(e, 1)
  131.             else
  132.               tempv = getAt(vppl, i) - getAt(e, 2)
  133.               tempv = random(tempv - 30)
  134.               tempv = getAt(vppl, i) - tempv
  135.               temph = getAt(hppl, i) - 200
  136.               if temph < 20 then
  137.                 temph = 20
  138.               end if
  139.               temph = random(400) + temph
  140.               if temph > 620 then
  141.                 temph = 620
  142.               end if
  143.             end if
  144.           end if
  145.           if abs(getAt(vppl, i) - tempv) > abs(getAt(hppl, i) - temph) then
  146.             if (getAt(vppl, i) - tempv) > 0 then
  147.               set the member of sprite getAt(ppl, i) to member(68, 1)
  148.             else
  149.               set the member of sprite getAt(ppl, i) to member(156, 1)
  150.             end if
  151.           else
  152.             set the member of sprite getAt(ppl, i) to member(93, 1)
  153.             if (getAt(hppl, i) - temph) > 0 then
  154.               sprite(getAt(ppl, i)).flipH = 1
  155.             else
  156.               sprite(getAt(ppl, i)).flipH = 0
  157.             end if
  158.           end if
  159.           setAt(ypnt, i, tempv)
  160.           setAt(xpnt, i, temph)
  161.         end if
  162.       end if
  163.     else
  164.       if count(bltsprite) < 16 then
  165.         thev = getAt(vppl, i) - getAt(vppl, 1)
  166.         theh = getAt(hppl, i) - getAt(hppl, 1)
  167.         if abs(thev) > abs(theh) then
  168.           if thev > 0 then
  169.             set the member of sprite getAt(ppl, i) to member(67, 1)
  170.           else
  171.             set the member of sprite getAt(ppl, i) to member(157, 1)
  172.           end if
  173.         else
  174.           if theh > 0 then
  175.             set the member of sprite getAt(ppl, i) to member(93, 1)
  176.             sprite(getAt(ppl, i)).flipH = 1
  177.           else
  178.             sprite(getAt(ppl, i)).flipH = 0
  179.             set the member of sprite getAt(ppl, i) to member(93, 1)
  180.           end if
  181.         end if
  182.         e = 1
  183.         repeat while e < 16
  184.           if the loc of sprite (49 + e) = point(690, 490) then
  185.             e = 49 + e
  186.             next repeat
  187.           end if
  188.           e = e + 1
  189.         end repeat
  190.         setAt(bltsprite, count(bltsprite) + 1, e)
  191.         setAt(bltwich, count(bltwich) + 1, "bad")
  192.         sound playFile 2, fxpath & "mashot.aif"
  193.         set the locH of sprite e to the locH of sprite getAt(ppl, i)
  194.         set the locV of sprite e to the locV of sprite getAt(ppl, i) - 30
  195.         if (thev < 20) and (thev > -20) then
  196.           setAt(blty, count(blty) + 1, 0)
  197.         else
  198.           if thev >= 20 then
  199.             setAt(blty, count(blty) + 1, -7)
  200.           else
  201.             if thev <= 20 then
  202.               setAt(blty, count(blty) + 1, 7)
  203.             end if
  204.           end if
  205.         end if
  206.         if (theh < 20) and (theh > -20) then
  207.           setAt(bltx, count(bltx) + 1, 0)
  208.         else
  209.           if theh >= 20 then
  210.             setAt(bltx, count(bltx) + 1, -7)
  211.           else
  212.             if theh <= 20 then
  213.               setAt(bltx, count(bltx) + 1, 7)
  214.             end if
  215.           end if
  216.         end if
  217.         if the memberNum of sprite getAt(ppl, i) < 76 then
  218.           setAt(mnv, i, 35)
  219.           yr = 76
  220.         else
  221.           if the memberNum of sprite getAt(ppl, i) < 105 then
  222.             setAt(mnv, i, 36)
  223.             yr = 105
  224.           else
  225.             if (the memberNum of sprite getAt(ppl, i) > 156) and (the memberNum of sprite getAt(ppl, i) < 165) then
  226.               setAt(mnv, i, 35)
  227.               yr = 81
  228.             end if
  229.           end if
  230.         end if
  231.         set the member of sprite getAt(ppl, i) to member(yr, 1)
  232.       end if
  233.     end if
  234.   else
  235.   end if
  236. end
  237.